#include <sys/types.h>
#include <unistd.h>
#include <iostream>
using namespace std;

int test(int small, int large);
void forkInLinux();

int main() {
  cout << test(1, 100) << endl;
  return 0;
}

int test(int small, int large) {
  int count = 0;
  while (small <= large) {
    count += small++;
  }
  return count;
}

void forkInLinux() {
  pid_t pid;

  pid = fork();

  if (pid < 0) {
    cout << "Error in fork!\n" << endl;
  } else if (pid == 0) {
    cout << "我是子进程, PID: " << getpid() << endl;
  } else {
    cout << "我是父进程, PID: " << getpid() << endl;
  }
}
